package ui;

import pulpcore.sprite.Group;
import pulpcore.sprite.Sprite;
import pulpcore.sprite.Button;

import java.util.List;
import java.util.ArrayList;

/**
 * @author will
 * @date Aug 10, 2008 1:04:25 PM
 */
public class ButtonGroup extends Group {

    public List<Button> buttons = new ArrayList<Button>();

    public void add(Sprite sprite) {
        if(!(sprite instanceof Button)) {
            return;
        }
        super.add(sprite);
        buttons.add((Button)sprite);
    }

    public void remove(Sprite sprite) {
        if(!(sprite instanceof Button)) {
            return;
        }
        super.remove(sprite);
        buttons.remove((Button)sprite);
    }
}
